import 'package:flutter/material.dart';

class LoadingState extends ChangeNotifier {
  bool _isLoading = false;
  String _loadingMessage = '加载中...';

  bool get isLoading => _isLoading;
  String get loadingMessage => _loadingMessage;

  void showLoading({String? message}) {
    _isLoading = true;
    _loadingMessage = message ?? '加载中...';
    notifyListeners();
  }

  void hideLoading() {
    _isLoading = false;
    notifyListeners();
  }
}